Fix some tests
authorAlex Crichton <alex@alexcrichton.com>
Thu, 10 Jul 2014 19:39:05 +0000 (12:39 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 10 Jul 2014 19:51:13 +0000 (12:51 -0700)
Makefile
tests/test_cargo_compile.rs
tests/test_cargo_test.rs

index 7a422faff7ca88262bcc54b71641893710bd831c..e10fedb1aafdf69c801f23db1390ec4f2a140f84 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,9 +7,11 @@ ifeq ($(wildcard rustc/bin),)
 export RUSTC := rustc
 else
 export RUSTC := $(CURDIR)/rustc/bin/rustc
+export LD_LIBRARY_PATH := $(CURDIR)/rustc/lib:$(LD_LIBRARY_PATH)
+export DYLD_LIBRARY_PATH := $(CURDIR)/rustc/lib:$(DYLD_LIBRARY_PATH)
 endif
 
-export PATH := $(PATH):$(CURDIR)/rustc/bin
+export PATH := $(CURDIR)/rustc/bin:$(PATH)
 
 # Link flags to pull in dependencies
 BINS = cargo \
index 54953514c898adab5b77709878c90c4fd2a3ba79..57ef09cebceddc413fd09b52ab9d9d4ee4349540 100644 (file)
@@ -1062,7 +1062,7 @@ test!(verbose_release_build_deps {
         --out-dir {dir}{sep}target{sep}release \
         -L {dir}{sep}target{sep}release \
         -L {dir}{sep}target{sep}release{sep}deps \
-        --extern foo={dir}/target/release/deps/libfoo{hash1}.rlib`
+        --extern foo={dir}{sep}target{sep}release{sep}deps/libfoo{hash1}.rlib`
 {compiling} foo v0.0.0 (file:{dir})
 {compiling} test v0.0.0 (file:{dir})\n",
                     running = RUNNING,
index ed3f488a4befb5626aa81a1e4e3a8518c605b0d6..bdc429a4ec31c8872577a237b1f57e0b29cb4068 100644 (file)
@@ -1,4 +1,7 @@
+use std::str;
+
 use support::{project, execs, basic_bin_manifest, COMPILING, cargo_dir};
+use support::{ResultTest};
 use hamcrest::{assert_that, existing_file};
 use cargo::util::process;
 
@@ -60,23 +63,26 @@ test!(test_with_lib_dep {
             fn bin_test() {}
         ");
 
-    assert_that(p.cargo_process("cargo-test"),
-                execs().with_status(0)
-                       .with_stdout(format!("\
-{compiling} foo v0.0.1 (file:{dir})
+    let output = p.cargo_process("cargo-test")
+                  .exec_with_output().assert();
+    let out = str::from_utf8(output.output.as_slice()).assert();
 
+    let bin = "\
 running 1 test
 test bin_test ... ok
 
-test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-
-
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured";
+    let lib = "\
 running 1 test
 test lib_test ... ok
 
-test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured";
+
+    let head = format!("{compiling} foo v0.0.1 (file:{dir})",
+                       compiling = COMPILING, dir = p.root().display());
 
-", compiling = COMPILING, dir = p.root().display()).as_slice()));
+    assert!(out == format!("{}\n\n{}\n\n\n{}\n\n", head, bin, lib).as_slice() ||
+            out == format!("{}\n\n{}\n\n\n{}\n\n", head, lib, bin).as_slice());
 })
 
 test!(test_with_deep_lib_dep {